package com.bwie.controller;

import com.bwie.common.result.Result;
import com.bwie.domain.PrizeEs;
import com.bwie.domain.req.PrizeEsReq;
import com.bwie.service.EsPrizeService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("prize")
public class EsPrizeController {
    @Autowired
    private EsPrizeService esPrizeService;

    /**
     * 创建索引
     * @return
     */
    @GetMapping("creatIndex")
    public Result creatIndex(){
        esPrizeService.creatIndex();
        return Result.success();
    }
    @PostMapping("prizeList")
    public Result prizeList(@RequestBody PrizeEsReq prizeEsReq){
        PageInfo<PrizeEs> list = esPrizeService.prizeList(prizeEsReq);
        return Result.success(list);
    }
}
